package com.cloud.cop.business.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloud.cop.ApiMethod;
import com.cloud.cop.CopResponse;
import com.cloud.cop.business.request.UserRequest;
import com.cloud.cop.business.response.AddUserResponse;

@Service
public class CloudOpenApis {
	
	@Autowired
	private UserService userService;
	
	@ApiMethod("api.user.add")
	public CopResponse saveUser(UserRequest request){
		AddUserResponse response = new AddUserResponse();
		try {
			response.setPassword(request.getPassword());
			response.setUserName(request.getUserName());
			userService.save();
		}catch(Exception e){
			e.printStackTrace();
		}
		return response;
	}
}
